package com.sise.dubbo.abtest.controller;

import com.sise.common.utils.SnowFlake;
import com.sise.dubbo.abtest.service.UserService;
import com.sise.dubbo.abtest.vo.UserVO;
import com.sise.dubbo.vo.WsResponseMsgVO;
import com.sise.dubbo.vo.WsResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @author zitian
 * @data 2019/1/12
 */

@RestController
@RequestMapping(value = "/AbTest")
@Slf4j
public class AbTestController {

    @Autowired(required = false)
    private UserService userService;

    @GetMapping(value = "/batchInsertUser")
    public WsResponseMsgVO<Boolean> batchInsertUser(){
        List<UserVO> userVOList=new ArrayList<>();
        for(int i=0;i<100;i++){
            UserVO userVO=new UserVO();
            userVO.setId((int) System.currentTimeMillis()+i);
            userVO.setAge(12);
            userVO.setSex(1);
            userVO.setPassword("password");
            userVO.setTel("15889793032");
            userVOList.add(userVO);
        }
        return WsResponseMsgVO.builderSuccessRespData(userService.batchInsertUserPO(userVOList));
    }
}
